home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet bezpieczenstwa
/
mini Pentoo LiveCD 2006.1
/
mpentoo-2006.1.iso
/
livecd.squashfs
/
usr
/
lib
/
python2.4
/
site-packages
/
pygtk.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2006-01-20
|
1KB
|
55 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.4)
import fnmatch
import glob
import os
import sys
__all__ = [
'require']
_pygtk_dir_pat = 'gtk-[0-9].[0-9]'
_pygtk_required_version = None
def _get_available_versions():
versions = { }
for dir in sys.path:
if not dir:
dir = os.getcwd()
if not os.path.isdir(dir):
continue
if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
continue
for filename in glob.glob(os.path.join(dir, _pygtk_dir_pat)):
pathname = os.path.join(dir, filename)
if not os.path.isdir(pathname):
continue
if not os.listdir(pathname):
continue
if not versions.has_key(filename[-3:]):
versions[filename[-3:]] = pathname
continue
return versions
def require(version):
global _pygtk_required_version
if _pygtk_required_version != None:
return None
versions = _get_available_versions()
for dir in sys.path:
if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
sys.path.remove(dir)
continue
sys.path.insert(0, versions[version])
_pygtk_required_version = version